#ifndef CODEHELPER_H
#define CODEHELPER_H

#include <vector>
#include "QString"
#include<QWidget>

enum EInputDataType{
    ASCIIGRID = 1,
    SHAPEFILE,
    CUSTOM
};

class CodeHelper
{
public:
    CodeHelper();

    void init(QWidget *Widget,QString javaHome,QString packageName,QString dirPath);

    //read Main.java
    bool readMainCode(EInputDataType dataType);

    //read ModelPackHandle.java
    bool readModelHandleCode();

    //read manifest.mf
    bool readMainfest();

    //read compile bat file
    bool readCompileBatFile();

    //license
    bool getLicense(QString AreaText);

    //compile
    bool otherCompile();

    //otherPackaged
    int otherPackaged();
    //save file
    bool saveFile(QString filename,QString& str);


    ////////////////////////////
    void setJavaHome(QString javaHome);
    QString& getJavaHome();

private:

    QString _javaHome;

    std::vector<QString> _dlls;//外部依赖库，C++库

    QString _packageName;//Java 程序的包名
    QString DirPath;  //工程路径
    QList<QString> *libNamesList; //libNamelist
    QWidget *widget;
};

#endif // CODEHELPER_H
